home *** CD-ROM | disk | FTP | other *** search
/ L' Effet Pommier 3 / L'Effet Pommier - Volume 03.iso / Utils□□□ Divers 2 / ResCompare 2.6 folder / Documentation / ResCompare Q & A < prev   
Text File  |  1996-02-06  |  8KB  |  63 lines

  1. ResCompare Q & A
  2.  
  3. I get quite a bit of e╨mail from people with questions about ResCompare. I╒ll attempt to answer some of them here. If you have a question, please read this document first, and if the answer isn╒t here, just send me e╨mail at hecht@vnet.net.
  4.  
  5. Q: Is it really free?
  6. A: Yes, it╒s really free. Use it without shame. Although I actually use ResCompare as a tool in my real job, it is mostly a hobby that I╒m willing to share with the world.
  7.  
  8. However, if you╒re using it to patch a commercial product, and you would like to bestow a gift upon me, I╒d definitely appreciate a free NFR copy. Send me e╨mail and I╒ll tell you my shipping address.
  9.  
  10. If you want to put it on a compilation CD╨ROM, send me e╨mail for permission, which I will probably grant at the cost of a complimentary copy of the CD. If you╒re an author and want to include ResCompare in your book╒s companion CD╨ROM, the same rule applies.
  11.  
  12. Q: Why do patches have a different version number than ResCompare does?
  13. A: History lesson: Originally, Patch was a separate application that operated on ╥Patch documents,╙ which ResCompare could create. As a separate app, it had its own version number. To protect against applying a patch with a more advanced file format using a version of Patch that predated it, ResCompare would copy the 'vers' of the corresponding Patch app into the Patch document. Since the file format changed a lot early on, Patch╒s version number went up pretty fast, and the two apps got out of sync.
  14.  
  15. However, users of the patches found the separate application confusing, so the ╥self╨applying patch╙ was born. But Patch still needed to keep its inflated version number to prevent someone from accidentally appending to an old patch using a newer version of ResCompare (with a newer file format). I╒ll get ╒em back in sync at some point.
  16.  
  17. Q: Can Patch be modified to change a file╒s type/creator? Can I make a single patch that changes several plug╨ins, which all have the same type/creator?
  18. A: That sounds useful, but unfortunately it is beyond the scope of this version of ResCompare. Although you can alter a patch to accept a wide variety of types and creators (see the 'ZTC#' resource in the ╥Patch File Format╙ doc), you cannot have the patch change the types or creators.
  19.  
  20. Also, when appending one patch to another, they are matched up by type/creator. Therefore, you cannot make a single patch that changes several files which all have the same type/creator (like a set of plug╨ins). The solution is to give each plug╨in a unique creator. You would have to do this anyway if you want it to have a unique icon.
  21.  
  22. Q: Can you change Patch to look for the target file based on its creation date/file size/etc.? My version numbers are all screwed up.
  23. A: Sorry. This version of ResCompare was designed specifically to rely on version numbers as defined by Apple Computer, Inc. When you append one patch to another for successive revisions of your application, they are sequenced by version number. If your version numbers are missing, not in a strictly ascending order, or otherwise awkwardly arranged, you can still make a patch, but it will be a ╥dumb╙ patch that has no idea where to start applying itself. Plan ahead and properly define the version numbers for each release.
  24.  
  25. Q: Can ResCompare be made to match resources by type and name instead of by type and ID?
  26. A: Another good idea, but here comes that ╥scope╙ answer again. ResCompare was designed specifically to rely on resource IDs matching up between versions. If your development environment randomly assigns 'CODE' segments to different IDs on successive builds, you may face this problem. The result is that 'CODE' resources look wildly different to ResCompare, and it takes a long time to difference them. The resulting patch will probably be somewhat bloated as well.
  27.  
  28. Perhaps a future redesigned version of ResCompare will address this issue, but with the future of resource files uncertain in Copland, who knows?
  29.  
  30. Q: My resources are compressed, and the patch file is huge! Whatever can I do?
  31. A: Sorry; compressed resources don╒t difference very well. Wouldn╒t it be cool if ResCompare could difference the uncompressed resources for patching? Then the patch could load a compressed resource, expand it, patch it, compress it again, and write it out. Unfortunately, that ╥Compress it again, Sam╙ step is the killer. I haven╒t come across any vendors who will let me incorporate their compression technology within Patch, to then be freely given away.
  32.  
  33. Q: That ╥Bummer╙ button in my patch looks unprofessional. Can I change it?
  34. A: If you like. Just open the patch in ResEdit and hack away. But first, I must subject you to my justification for the button name. This alert appears when, for whatever reason, a patch fails to apply. The alternative button name would be ╥OK,╙╩but to the user this situation is not ╥OK.╙ I think it╒s a bit sardonic to force the user to click a button that implies ╥everything is hunky╨dory.╙ Similar logic applies to the ╥Cool!╙ button.
  35.  
  36. As for the ╥unprofessional╙ argument, I think the ╥Bummer╙ button (in the unlikely event that a user sees it) and its friend the ╥Cool!╙ button add a touch of personality to an otherwise dry process. It╒s kinda like those floating floppy disk icons in Apple╒s Installer. And my company has shipped real patches for commercial products to real users and received nothing but praise for the button names (from those users who cared to mention them at all).
  37.  
  38. Anyway, if you wish to bow to conformity, I humbly recommend that you change ╥Bummer╙ to ╥Quit╙ and ╥Cool!╙ to ╥OK.╙
  39.  
  40. Q: What other features of a patch can I change?
  41. A: Within the confines of what is humanly possible with ResEdit, you have my permission to change just about any aspect of a patch╒s user interface. Change its icon, its dialogs, its error messages, whatever. Go wild!
  42.  
  43. One part of the patch that I really really want you to change is the text of the patch info dialog. This is so simple to do in ResEdit; please don╒t neglect it. At the very least, please include some form of contact information (preferably your e╨mail address) for yourself in the patch notes. You would not believe the amount of e╨mail I receive from people who are trying to add Jim╨Bob╒s mutant stereo sounds to their copy of Marathon using some patch they downloaded from AOL. Sheesh!
  44.  
  45. As for the rest of the patch, my only restrictions are that you leave the following two things:
  46. Ñ The PICT item on the patch info dialog that identifies ResCompare as the patch╨making tool.
  47. Ñ The 'vers' 1 resource, which includes my copyright notice.
  48.  
  49. Q: Doesn╒t that copyright notice give you a legal copyright to my software?
  50. A: Not true! My copyright simply covers the patch application itself, not the item being patched. If you don╒t believe me, ask Aladdin. An installer made with Stuffit InstallerMaker has Aladdin╒s copyright on it, but that does not give them a legal claim to every piece of software that uses their installer. If you want to put your own copyright on the patch, please use the 'vers' 2 resource instead.
  51.  
  52. Q: What algorithm does ResCompare use to find differences?
  53. A: The problem is referred to in computing literature as that of finding the ╥longest common subsequence╙ between two strings, and believe me, there is quite a bit of literature about it. Much of the offerings simply set out to show just how intractable a problem it really is. Others provide algorithms that fall into two camps: those best for mostly similar strings, and those best for mostly different strings. Of course, you have to know a priori which kind of algorithm to use!
  54.  
  55. ResCompare uses an algorithm based loosely on the one described in
  56.  
  57.     S. Wu, U. Manber, G. Myers and W. Miller, An O(NP) Sequence Comparison Algorithm,
  58.         Information Processing Letters 35 (1990) 317-323.
  59.  
  60. If you╒re really interested in such things, I suggest you start reading there. This algorithm treats the problem as a shortest-path search. With each iteration, the breadth of the search increases. My modified version is somewhat less intelligent, but faster and less consumptive of memory. If you really want the gory details, drop me a line. I can provide a more detailed bibliography as well, if you like.
  61.  
  62. ╤ Michael Hecht
  63.